import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './plugins/element.js'
import * as echarts from 'echarts'
import axios from 'axios'

axios.defaults.baseURL="http://localhost:3000"
Vue.prototype.$echarts = echarts
Vue.prototype.$axios = axios
Vue.config.productionTip = false
Vue.prototype.$EventBus = new Vue()
//取得本地存储记录
Vue.prototype.$getItem=function(value){
  return JSON.parse(localStorage.getItem(value))
}
//添加本地存储记录，不支持数组内添加
Vue.prototype.$setItem=function(key,value){
  value=JSON.stringify(value)
  if(localStorage.getItem(value)==null||localStorage.getItem(value)==""){
    localStorage.setItem(key,value)
  }else {
    localStorage.setItem(key,value)
  }
}

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
